{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fae114c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from flask import Flask,request\n",
    "from flask import render_template\n",
    "\n",
    "app = Flask(__name__)\n",
    "\n",
    "@app.route(\"/\",methods = ['GET'])\n",
    "def 首页():\n",
    "    return render_template('首页.html')\n",
    "\n",
    "@app.route(\"/名字全称\",methods = ['GET'])\n",
    "def 名字全称():\n",
    "    return render_template('名字全称.html')\n",
    "\n",
    "@app.route(\"/第一个结束页\",methods = ['POST'])\n",
    "def 第一个结束页():\n",
    "    py_firstname = request.form['firstname']\n",
    "    py_lastname = request.form['lastname']\n",
    "    py_fullname = py_firstname.title() + ' '+ py_lastname.title()\n",
    "    \n",
    "    return render_template('第一个结束页.html',\n",
    "                          fullname = py_fullname)\n",
    "\n",
    "@app.route(\"/元音字母\",methods = ['GET'])\n",
    "def 元音字母():\n",
    "    return render_template('元音字母.html')\n",
    "\n",
    "@app.route(\"/第二个结束页\",methods = ['POST'])\n",
    "def 第二个结束页():\n",
    "    py_word = request.form['word']\n",
    "    py_vowels = request.form['vowels']\n",
    "    py_found = {}\n",
    "    for i in py_word:\n",
    "        if i in py_vowels:\n",
    "            py_found.setdefault(i,0)\n",
    "            py_found[i] +=1\n",
    "    return render_template('第二个结束页.html',\n",
    "                          found = py_found)\n",
    "    \n",
    "@app.route(\"/圣诞树\",methods = ['GET'])\n",
    "def 圣诞树():\n",
    "    return render_template('圣诞树.html')\n",
    "\n",
    "\n",
    "if __name__== '__main__':\n",
    "    app.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ae28b43f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
